/**
 * @summary 用户模块
 * @author 徐靖宇
 */

import * as userApi from '@/api/user';

export default {
  namespaced: true,
  state: {
    // 用户信息
    userInfo: {},
  },
  mutations: {
    SET_USER_INFO(state, newValue) {
      state.userInfo = newValue;
    },
  },
  actions: {
    async updateUserInfo({ commit }) {
      const res = await userApi.getUserInfo();
      commit('SET_USER_INFO', res);
    },
  },
};
